import { Component, OnInit, AfterViewInit } from '@angular/core';

@Component({
  selector: 'app-navigation',
  templateUrl: './navigation.component.html',
  styleUrls: ['./navigation.component.scss'],
})
export class NavigationComponent implements OnInit, AfterViewInit {
  disableAnimation = true;
  navGroups: {
    name: string;
    icon?: string;
    items: {
      name: string;
      isExternalUrl: boolean;
      url: string;
      icon?: string;
    }[];
  }[] = [
    {
      name: '概览',
      icon: 'dashboard',
      items: [
        {
          name: '仪表盘',
          icon: 'dashboard',
          isExternalUrl: false,
          url: '/dashboard',
        },
        {
          name: '百度',
          isExternalUrl: true,
          url: 'https://www.baidu.com',
        },
      ],
    },
    {
      name: '系统配置',
      icon: 'settings',
      items: [
        {
          name: '用户管理',
          icon: 'person',
          isExternalUrl: false,
          url: '/users',
        },
        {
          name: '组织管理',
          isExternalUrl: false,
          url: '/organizations',
        },
        {
          name: '个人设置',
          icon: 'person',
          isExternalUrl: false,
          url: '/settings',
        },
      ],
    },
  ];
  constructor() {}
  ngAfterViewInit(): void {
    setTimeout(() => (this.disableAnimation = false));
  }

  ngOnInit(): void {}
}
